package com.zezheng.extract.project.anxinsign.dto.response;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel(description = "响应头")
@Data
public class HeaderDTO {

    @JSONField(name = "txTime")
    @ApiModelProperty(value = "交易时间：yyyyMMddHHmmss")
    private String txTime;

    @JSONField(name = "retCode")
    @ApiModelProperty(value = "返回代码")
    private String retCode = "";

    @JSONField(name = "retMessage")
    @ApiModelProperty(value = "返回信息")
    private String retMessage = "";

    @JSONField(name = "errorCode")
    @ApiModelProperty(value = "返回代码（错误码）")
    private String errorCode;

    @JSONField(name = "errorMessage")
    @ApiModelProperty(value = "返回信息（错误信息）")
    private String errorMessage;

    @JsonIgnore
    @JSONField(serialize = false, deserialize = false)
    public boolean isSuccess() {
        return "60000000".equals(this.retCode);
    }
}
